package com.sxf.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import tk.mybatis.mapper.common.Mapper;

import com.sxf.dao.UserDAO;
import com.sxf.domain.User;
import com.sxf.domain.UserMeta;
import com.sxf.domain.viewbean.UserVO;
import com.sxf.mybatis.page.Pagination;
import com.sxf.querybean.UserQuery;
import com.sxf.service.UserService;

@Service
public class UserServiceImpl implements UserService {
	@Resource
	private UserDAO dao;
	
	@Autowired
    protected Mapper<User> mapper;

	@Override
	public List<UserVO> queryList(UserQuery query) {
		return dao.queryList(query);
	}

	@Override
	public Pagination<UserVO> queryPage(UserQuery query) {
		return dao.queryPage(query);
	}

	@Override
	public long queryNumber(UserQuery query) {
		return dao.queryNumber(query);
	}

	@Override
	public int insert(User User) {
		return dao.insert(User);
	}

	@Override
	public int update(User User) {
		return dao.update(User);
	}

	@Override
	public int delete(User user) {
		return dao.delete(user);
	}

	@Override
	public long insertUserMeta(UserMeta userMeta) {
		return dao.insertUserMeta(userMeta);
	}

	@Override
	public int updateUserMeta(UserMeta userMeta) {
		return dao.updateUserMeta(userMeta);
	}

	@Override
	public int deleteUserMeta(UserMeta userMeta) {
		return dao.deleteUserMeta(userMeta);
	}

	public void setDao(UserDAO ud) {
		this.dao = ud;
	}

}
